﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Header.ascx.cs" Inherits="BSPortal.Usercontrol.Header" %>
<%@ Import Namespace="BSPortal" %>
<div class="top">	
    <div class="top_bg">
        <div class="header_box" align="left">
            <div class="middle_header">
                <a href="/trangchu.html" rel="nofollow">
                    <div id="solo_logo"></div>
                </a>
                <div class="">
                    <div style="float: right; margin: 10px">
                        <asp:HyperLink runat="server" NavigateUrl="/doi-thong-tin.html" ID="lblUsername"></asp:HyperLink>
                        <asp:LinkButton runat="server" ID="hpLinkLogin" onclick="hpLinkLogin_Click">Đăng nhập</asp:LinkButton>
                        <asp:LinkButton runat="server" ID="hpLinkCheckOut" onclick="hpLinkCheckOut_Click"> | Đăng Ký</asp:LinkButton>
                        <asp:LinkButton runat="server" ID="hpLinkLogout" onclick="hpLinkLogin_Click"> | Đăng xuất</asp:LinkButton>
                        <br/>
                        <a href="gio-hang.html">Giỏ hàng</a> <asp:HyperLink ID="AdminLink" runat="server" NavigateUrl="/Admin.aspx" Text="Admin page"/>
                    </div>
                    <div style="float: right; right: -70px; position: relative; top: 60px">
                        <script type="text/javascript">
                            // Replaces all instances of the given substring.
                            String.prototype.replaceAll = function (  strTarget, strSubString  ) {
                                var strText = this;
                                var intIndexOfMatch = strText.indexOf(strTarget);

                                // Keep looping while an instance of the target string
                                // still exists in the string.
                                while (intIndexOfMatch != -1) {
                                    // Relace out the current instance.
                                    strText = strText.replace(strTarget, strSubString)

                                    // Get the index of any next matching substring.
                                    intIndexOfMatch = strText.indexOf(strTarget);
                                }

                                // Return the updated string with ALL the target strings
                                // replaced out with the new substring.
                                return (strText);
                            }
                            function SearchPage()
                            {
                                var key = document.getElementById("txtKey").value;
                                key = key.replaceAll(" ", "_");
                                var path = '<%= string.Format("/timkiem-{0}-", Common.GetLine())%>';
                                path += key;
                                window.location.href = path+'.html';
                            }

                            function SearchGoogle() {
                                var key = document.getElementById("txtKey").value;
                                var path = 'https://www.google.com/search?q=' + key + '&sitesearch=72h.vn';
                                window.location.href = path;
                            }
                        </script>
                        <div>
                            <input type="text" name="q" id="txtKey" title="Nhập tiếng Việt có dấu"
                                style="width:250px; height:20px;" onfocus="this.value=''" value="Nhập từ khoá tìm kiếm">
                            <input type="button" value="72H Search" style="width:100px;" onclick="SearchPage(); return false;">
                            <input type="button" value="Google Search" style="width:100px;" onclick="SearchGoogle(); return false;">
                            <input type="checkbox" name="sitesearch" value="72h.vn" checked="true" style="display:none">
                        </div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
            <div class="bottom_header">
                <ul class="menu_top">
                    <li class=""><a href="/trangchu.html">Trang Chủ</a></li>
                    <li class=""><a href="/sach.html">Sách</a></li>
                    <li class=""><a href="/thiet-bi-dien-tu.html">Thiết bị điện tử</a></li>
                    <li class=""><a href="/gia-dinh.html">Gia đình</a></li>
                    <li class=""><a href="/lien-he.html">Liên hệ</a></li>
                    <li class=""><a href="/huong-dan.html">Hướng dẩn</a></li>
                    <li class=""><a href="/bao-hanh.html">Bảo hành</a></li>
                </ul>
                <div class="clear"></div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="clear"></div>
    </div>
</div>
<style>
    .divSupport {
        width:100%;position:absolute;  top:0px;
    }
    .popupInfo {
        width:400px;
        display:none;
    }
    
    .linkSupport {
       width:150px;
    }
</style>
<div align="center" class="divSupport" onmouseout="hidePopup()">
    <div class="popupInfo"  onmouseover="showPopup()" onmouseout="hidePopup()">
        <asp:PlaceHolder runat="server" id="supportContent">
        </asp:PlaceHolder>
    </div>
    <a href="#" class="linkSupport" onmouseover="showPopup()">Hổ Trợ Nhanh</a>
</div>
<script>
    function showPopup() {
        $(".popupInfo").css("display", "block");
        $(".linkSupport").css("display", "none");
    }
    function hidePopup() {
        $(".popupInfo").css("display", "none");
        $(".linkSupport").css("display", "block");
    }
</script>